#include "threadPool.h"
#include "threadPool.h"
#define RANDOM_SALT_SIZE 16
#define SALT_SIZE 21
char * createRandomSalt(){
    char *salt = (char *)calloc(SALT_SIZE,sizeof(char));
    salt[0]='$';
    salt[1]='6';
    salt[2]='$';
    //生成随机字符串的数组
    char alphArr[65]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q',
                      'r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H',
                      'I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y',
                      'Z','0','1','2','3','4','5','6','7','8','9','.','/'};
    srand(time(NULL));//设置随机数种子
    int index;
    for(int i=0;i<RANDOM_SALT_SIZE;++i){
        index = rand()%strlen(alphArr);
        salt[i+3] = alphArr[index];
        DEBUG_PRINT("index = %d\n",index);
    printf("salt = %s\n",salt);
    }
    salt[SALT_SIZE-2]='$';
    salt[SALT_SIZE-1]='\0';
    printf("salt = %s\n",salt);
    return salt;
}

